﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../Scripts/jquery-1.8.2.js"></script>
    <script src="../Scripts/basejs.js"></script>
    <script src="../Scripts/Formjs.js"></script>
    <link href="../bootstrap/css/bootstrap.css" rel="stylesheet" />
</head>
<body >
    <div class="span8">
        <form id="f1" action="/user/regedit" fm-form="ajax" method="post" class="form-horizontal">
            <fieldset>
                <legend>表单控件状态</legend>
                <div class="form-group control-group ">
                    <label>用户名(验证空，长度，ajax(admin已存在))</label>
                    <input type="text" name="Name" class="form-control" fm-null="用户名不能为空！" fm-len="4,20,用户名长度必须大于4小于20！" fm-ajax="/user/has,用户名已存在!" placeholder="用户名">
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group ">
                    <label>密码(验证长度)</label>
                    <input type="password" name="pwd" fm-len="6,,密码长度不能小于6位！" class="form-control" placeholder="密码">
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group ">
                    <label>确认密码(验证相同输入)</label>
                    <input type="password" class="form-control" name="pwd1" fm-eq="pwd,两次输入密码不一致！" placeholder="确认密码">
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group ">
                    <label>Email (正则表达式验证)</label>
                    <input type="email" class="form-control" fm-reg="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*,请输入正确的邮箱格式！" name="email" placeholder="email">
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group " fm-group="radio,请选择性别！">
                    <label>性别 (radio组验证)</label>
                    女：<input type="radio" name="six" value="0" /> 男：<input type="radio" name="six" value="1" />
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group " fm-group="checkbox,2,4,请任选2项！最多4项！">
                    <label>爱好 (checkbox组验证)</label>
                    <input type="checkbox" name="interest" value="0" />吃饭<input type="checkbox" name="interest" value="1" />睡觉
                    <input type="checkbox" name="interest" value="2" />看电影<input type="checkbox" name="interest" value="3" />逛街
                    <input type="checkbox" name="interest" value="4" />其他
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group ">
                    <label>地区(不等于验证) </label>
                    <select name="area" fm-neq="-1,请选择地区!">
                        <option value="-1">请选择地区</option>
                        <option>北京</option>
                        <option>杭州</option>
                        <option>上海</option>
                    </select>
                    <span class="help-inline"></span>
                </div>
                <div class="form-group control-group ">
                    <label>备注 (长度验证)</label>
                    <textarea name="summay" fm-len="4,200,请输入备注，大于4个字符，小于200个字符!"></textarea>
                    <span class="help-inline"></span>
                </div>
                <!--<input type="hidden" name="Gid" fm-null="请选择gid" value="" />-->
                <input type="hidden" name="Uid" />
                <button type="reset" class="btn">重置</button>
                <button type="submit" class="btn btn-default">提交</button>
            </fieldset>
        </form>
        <button type="button" id="btnres" class="btn">js重置</button>
    </div>

    

    <script>
        
        $(document).ready(function () {
            var form = $("#f1").Form();


            $("#btnres").click(function () {
                form.reset();
            });
            
        });

    </script>
</body>

</html>
